package at.fhj.itm11.forum.service.stubs;

import java.rmi.RemoteException;

import at.fhj.itm11.forum.model.User;
import at.fhj.itm11.forum.ws.FHJForumAuthWS_PortType;

public class FHJForumAuthWS_PortTypeStub implements FHJForumAuthWS_PortType {

	public User testUser;
	public Object exceptionToThrow;
	
	@Override
	public boolean authUser(String username, String password)
			throws RemoteException {
		
		if(exceptionToThrow instanceof RemoteException) {
			throw (RemoteException)exceptionToThrow;
		}
			
		if(testUser.getUsername().equals(username) && testUser.getPassword().equals(password)) {
			return true;
		}
		
		return false;
	}

}
